t = int(input())
for _ in range(t):
    n = int(input())
    s = input()
    if (n == 7 and s.count('L') == 1 and s.count('a') == 2 and s.count('n') == 1
        and s.count('q') == 1 and s.count('i') == 1 and s.count('o') == 1):
        print('YES')
    else:
        print('NO')